<?php
require 'vendor/Phpquery/autoload.php';
require 'vendor/Qiniu/autoload.php';
use QL\QueryList;
use Qiniu\Auth;
use Qiniu\Storage\UploadManager;

// 用于签名的公钥和私钥
$qiniu_key = '6tlTXdC9jJqqARNW-oaRtDHesA901SWJ3YJXq9Ty';
$qiniu_security = 'TvFPjkNTJA5xKbxokGOFmWalttH7SW0ty-ubTHrc';
// 初始化签权对象
$auth = new Auth($qiniu_key, $qiniu_security);

$bucket = 'guanwang';

// 初始化签权对象
$auth = new \Qiniu\Auth($qiniu_key, $qiniu_security);
$token = $auth->uploadToken($bucket);
$uploadMgr = new UploadManager();
list($ret, $err) = $uploadMgr->putFile($token,'ce1.jpg','./ce.jpg');
if ($err !== null) {
    var_dump($err);
} else {
   echo  'success!';
}